﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="SystemErrorManager.ascx.cs" Inherits="MD_Asset.Controls.Systems.SystemErrorManager" %>
<table border="0" cellpadding="0" cellspacing="0" style="width: 100%">
    <tr>
        <td style="width: 80px">
            Chuỗi tìm:</td>
        <td style="width: 280px">
            <asp:TextBox ID="txtSearch" runat="server" Width="115px"></asp:TextBox>
            <asp:DropDownList ID="ddlErrorType" runat="server" DataTextField="ErrorTypeName"
                DataValueField="ErrorTypeID" Width="150px">
            </asp:DropDownList></td>
        <td style="width: 195px">
            <telerik:RadDatePicker ID="txtDateFrom" runat="server" Culture="Vietnamese (Vietnam)"
                Width="89px">
                <DateInput InvalidStyleDuration="100">
                </DateInput>
            </telerik:RadDatePicker>
            &nbsp;-
            <telerik:RadDatePicker ID="txtDateTo" runat="server" Culture="Vietnamese (Vietnam)"
                Width="89px">
                <DateInput InvalidStyleDuration="100">
                </DateInput>
            </telerik:RadDatePicker>
        </td>
        <td>
            <asp:CheckBox ID="chkStatus" runat="server" Checked="True" Text="Chưa fix" />
            <asp:Button ID="btnSearch" runat="server" CssClass="Control_Button1" OnClick="btnSearch_Click"
                Text="Tìm kiếm" />
            <asp:Button ID="btnFix" runat="server" CssClass="Control_Button1" Text="Chuyển trạng thái"
                OnClick="btnFix_Click" />
            <asp:Button ID="btnDelete" runat="server" CssClass="Control_Button1" OnClick="btnDelete_Click"
                OnClientClick="return confirm('Bạn có chắc muốn xóa dữ liệu này!');" Text="Xoá" />
            <asp:Button ID="btnReturn" runat="server" CssClass="Control_Button1" Text="Trở về"
                UseSubmitBehavior="False" /></td>
    </tr>
</table>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
        <div class="Height1">
        </div>
        <asp:GridView ID="grvObjectList" runat="server" AllowPaging="True" AutoGenerateColumns="False"
            CssClass="Gridview" EmptyDataText="<center>Không tìm thấy dữ liệu thoả yêu cầu</center>"
            OnPageIndexChanging="grvObjectList_PageIndexChanging" PageSize="20" Width="100%">
            <Columns>
                <asp:BoundField DataField="ErrorID" HeaderText="M&#227; số">
                    <ItemStyle CssClass="Gridview_Column_ID" Width="40px" />
                </asp:BoundField>
                <asp:BoundField DataField="ErrorTypeName" HeaderText="Loại lỗi" />
                <asp:BoundField DataField="ErrorCaption" HeaderText="Tiêu đề" />
                <asp:TemplateField HeaderText="Trạng thái">
                    <ItemStyle/>
                    <ItemTemplate>
                        <span>
                            <%#Eval("ErrorContent").ToString()%>
                        </span>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="ActionError" HeaderText="Thao tác gây lỗi" />
                <asp:BoundField DataField="ModuleName" HeaderText="Module lỗi" />
                <asp:TemplateField HeaderText="Trạng thái">
                    <ItemStyle HorizontalAlign="Center" />
                    <ItemTemplate>
                        <%#Convert.ToBoolean(Eval("IsFix")) ? "<span style='color: blue'>Đã fix</span>" : "<span style='color: red'>Chưa fix</span>"%>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Người tạo lỗi">
                    <ItemStyle HorizontalAlign="Center" />
                    <ItemTemplate>
                        <%# Eval("ErrorUser") + "<br />(" + Convert.ToDateTime(Eval("CreatedDate")).ToString(ConfigurationManager.AppSettings["DateFormat"]) + ")"%>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField>
                    <ItemTemplate>
                        <input id="iptSelect" name="iptSelect" onclick="Item_Select('selectall', 'iptSelect');"
                            title="Chọn" type="checkbox" value='<%#Eval("ErrorID") %>' />
                    </ItemTemplate>
                    <HeaderTemplate>
                        <input id="selectall" name="selectall" onclick="javascript:CheckAll('iptSelect', this.checked);"
                            type="checkbox" />
                    </HeaderTemplate>
                </asp:TemplateField>
            </Columns>
            <RowStyle CssClass="Gridview_RowStyle" />
            <PagerStyle CssClass="Gridview_Pager" />
            <HeaderStyle CssClass="Gridview_Header" />
        </asp:GridView>
    </ContentTemplate>
    <Triggers>
        <asp:AsyncPostBackTrigger ControlID="btnSearch" EventName="Click" />
        <asp:AsyncPostBackTrigger ControlID="btnFix" EventName="Click" />
        <asp:AsyncPostBackTrigger ControlID="btnDelete" EventName="Click" />
    </Triggers>
</asp:UpdatePanel>
